package com.bi.bitest.bao.entity.AlbumDetail;

import android.os.Parcel;
import android.os.Parcelable;
import com.bi.bitest.bao.entity.Parsable;
import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created
 * Author:bi[FR]
 * Date:15-10-23
 */
public class Tracks implements Parsable,Parcelable{


    /**
     * trackId : 93814141242147933
     * uid : 1000512421414141496
     * playUrl64 : http://fdfs.xmcdn.com/group7/M05/89/36/wKgDX1YmU5_CdQbSAN_aTJ17d1o811.mp3
     * playUrl32 : http://fdfs.xmcdn.com/group7/M05/89/36/wKgDX1YmU5axWxIMAG_tPcqEgys840.mp3
     * downloadUrl : http://download.xmcdn.com/group7/M05/89/2A/wKgDWlYm
     * coverSmall : http://fdfs.xmcdn.com/group15/M05/88/A2/wKgDZVYmTaPD_fNBAAFtApzU4ORO19xAHQka4ZoEFY825.aac
     * playPathAacv164 : http://audio.xmcdn.com/group7/M05/89/2B/wKgDWlYmU5aSUFm3AOJKMRNCOOQ212.m4a
     * playPathAacv224 : http://audio.xmcdn.com/group7/M05/89/2B/wKgDWlYmU4yRBD0qAFZf8EJZxvM062.m4a
     * downloadAacUrl : http://audio.xmcdn.com/group7/M05/89/2B/wKgDWlYmU4yRBD0qAFZf8EJZxvM062.m4a
     * title : 糗事播报之重阳席上赋白菊，周二播报颇有趣——采采（2015.10.20）
     * duration : 1833
     * processState : 2
     * createdAt : 1445352330000bD-s098_web_meduim.jpg
     * coverMiddle : http://fdfs.xmcdn.com/group15/M05/88/A2/wKgDZVYmTaPD_fNBAAFtApzbD-s098_web_large.jpg
     * coverLarge : http://fdfs.xmcdn.com/group15/M05/88/A2/wKgDZVYmTaPD_fNBAAFtApzbD-s098_mobile_large.jpg
     * nickname : 糗事播报
     * smallLogo : http://fdfs.xmcdn.com/group5/M05/90/97/wKgDtlRsQJmxnPW6AABmeagRyv0922_mobile_small.png
     * userSource : 1
     * albumId : 20323432423423355
     * albumTitle : 段子来了
     * albumImage : http://fdfs.xmcdn.com/group5/M03/A6/D8/wKgDtlR1MD_T1DQHAANqZDyk48s720_mobile_small.jpg
     * orderNum : 9999914141414999
     * opType : 2
     * refUid : 2629124132432143214577
     * refNickname : 枕边疯电台
     * refSmallLogo : http://fdfs.xmcdn.com/group3/M00/64/F8/wKgDslJ68TnQpnVPAAU-A1zGGqI128_mobile_small.jpg
     * isPublic : true
     * likes : 3413
     * playtimes : 2932432143243213692
     * comments : 11434214214243247
     * shares : 32325235325344
     * status : 1
     * downloadSize : 76114234234242499
     * downloadAacSize : 5660623424256
     */

    private long trackId;
    private long uid;
    private String playUrl64;
    private String playUrl32;
    private String downloadUrl;
    private String playPathAacv164;
    private String playPathAacv224;
    private String downloadAacUrl;
    private String title;
    private String duration;
    private int processState;
    private long createdAt;
    private String coverSmall;
    private String coverMiddle;
    private String coverLarge;
    private String nickname;
    private String smallLogo;
    private int userSource;
    private long albumId;
    private String albumTitle;
    private String albumImage;
    private long orderNum;
    private int opType;
    private String refUid;
    private String refNickname;
    private String refSmallLogo;
    private boolean isPublic;
    private int likes;
    private long playtimes;
    private long comments;
    private long shares;
    private int status;
    private long downloadSize;
    private long downloadAacSize;

    @Override
    public void parseJSON(JSONObject json) throws JSONException {
        trackId=json.getLong("trackId");
        uid=json.getLong("uid");
        playUrl64=json.getString("playUrl64");
        playUrl32=json.getString("playUrl32");
        downloadUrl=json.getString("downloadUrl");
        playPathAacv164=json.getString("playPathAacv164");
        playPathAacv224=json.getString("playPathAacv224");
        downloadAacUrl=json.getString("downloadAacUrl");
        title=json.getString("title");
        duration=json.getString("duration");
        processState=json.optInt("processState");
        createdAt=json.optLong("createdAt");
        coverSmall=json.optString("coverSmall");
        coverMiddle=json.optString("coverMiddle");
        coverLarge=json.optString("coverLarge");
        nickname=json.getString("nickname");
        smallLogo=json.getString("smallLogo");
        userSource=json.optInt("userSource");

        albumId=json.getLong("albumId");
        albumTitle=json.getString("albumTitle");
        albumImage=json.getString("albumImage");
        orderNum=json.optLong("orderNum");
        opType=json.optInt("opType");
        playtimes=json.getLong("playtimes");
        comments=json.getLong("comments");
        shares=json.getLong("shares");
        status=json.optInt("status");
        downloadSize=json.getLong("downloadSize");
        downloadAacSize=json.getLong("downloadAacSize");

    }

    public Tracks() {
    }

    public Tracks(long trackId) {
        this.trackId = trackId;
    }

    public void setTrackId(long trackId) {
        this.trackId = trackId;
    }

    public void setUid(long uid) {
        this.uid = uid;
    }

    public void setPlayUrl64(String playUrl64) {
        this.playUrl64 = playUrl64;
    }

    public void setPlayUrl32(String playUrl32) {
        this.playUrl32 = playUrl32;
    }

    public void setDownloadUrl(String downloadUrl) {
        this.downloadUrl = downloadUrl;
    }

    public void setPlayPathAacv164(String playPathAacv164) {
        this.playPathAacv164 = playPathAacv164;
    }

    public void setPlayPathAacv224(String playPathAacv224) {
        this.playPathAacv224 = playPathAacv224;
    }

    public void setDownloadAacUrl(String downloadAacUrl) {
        this.downloadAacUrl = downloadAacUrl;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public void setDuration(String duration) {
        this.duration = duration;
    }

    public void setProcessState(int processState) {
        this.processState = processState;
    }

    public void setCreatedAt(long createdAt) {
        this.createdAt = createdAt;
    }

    public void setCoverSmall(String coverSmall) {
        this.coverSmall = coverSmall;
    }

    public void setCoverMiddle(String coverMiddle) {
        this.coverMiddle = coverMiddle;
    }

    public void setCoverLarge(String coverLarge) {
        this.coverLarge = coverLarge;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public void setSmallLogo(String smallLogo) {
        this.smallLogo = smallLogo;
    }

    public void setUserSource(int userSource) {
        this.userSource = userSource;
    }

    public void setAlbumId(long albumId) {
        this.albumId = albumId;
    }

    public void setAlbumTitle(String albumTitle) {
        this.albumTitle = albumTitle;
    }

    public void setAlbumImage(String albumImage) {
        this.albumImage = albumImage;
    }

    public void setOrderNum(long orderNum) {
        this.orderNum = orderNum;
    }

    public void setOpType(int opType) {
        this.opType = opType;
    }

    public void setRefUid(String refUid) {
        this.refUid = refUid;
    }

    public void setRefNickname(String refNickname) {
        this.refNickname = refNickname;
    }

    public void setRefSmallLogo(String refSmallLogo) {
        this.refSmallLogo = refSmallLogo;
    }

    public void setIsPublic(boolean isPublic) {
        this.isPublic = isPublic;
    }

    public void setLikes(int likes) {
        this.likes = likes;
    }

    public void setPlaytimes(long playtimes) {
        this.playtimes = playtimes;
    }

    public void setComments(long comments) {
        this.comments = comments;
    }

    public void setShares(long shares) {
        this.shares = shares;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public void setDownloadSize(long downloadSize) {
        this.downloadSize = downloadSize;
    }

    public void setDownloadAacSize(long downloadAacSize) {
        this.downloadAacSize = downloadAacSize;
    }

    public long getTrackId() {
        return trackId;
    }

    public long getUid() {
        return uid;
    }

    public String getPlayUrl64() {
        return playUrl64;
    }

    public String getPlayUrl32() {
        return playUrl32;
    }

    public String getDownloadUrl() {
        return downloadUrl;
    }

    public String getPlayPathAacv164() {
        return playPathAacv164;
    }

    public String getPlayPathAacv224() {
        return playPathAacv224;
    }

    public String getDownloadAacUrl() {
        return downloadAacUrl;
    }

    public String getTitle() {
        return title;
    }

    public String getDuration() {
        return duration;
    }

    public int getProcessState() {
        return processState;
    }

    public long getCreatedAt() {
        return createdAt;
    }

    public String getCoverSmall() {
        return coverSmall;
    }

    public String getCoverMiddle() {
        return coverMiddle;
    }

    public String getCoverLarge() {
        return coverLarge;
    }

    public String getNickname() {
        return nickname;
    }

    public String getSmallLogo() {
        return smallLogo;
    }

    public int getUserSource() {
        return userSource;
    }

    public long getAlbumId() {
        return albumId;
    }

    public String getAlbumTitle() {
        return albumTitle;
    }

    public String getAlbumImage() {
        return albumImage;
    }

    public long getOrderNum() {
        return orderNum;
    }

    public int getOpType() {
        return opType;
    }

    public String getRefUid() {
        return refUid;
    }

    public String getRefNickname() {
        return refNickname;
    }

    public String getRefSmallLogo() {
        return refSmallLogo;
    }

    public boolean getIsPublic() {
        return isPublic;
    }

    public int getLikes() {
        return likes;
    }

    public long getPlaytimes() {
        return playtimes;
    }

    public long getComments() {
        return comments;
    }

    public long getShares() {
        return shares;
    }

    public int getStatus() {
        return status;
    }

    public long getDownloadSize() {
        return downloadSize;
    }

    public long getDownloadAacSize() {
        return downloadAacSize;
    }


    @Override
    public String toString() {
        return "Tracks{" +
                "trackId=" + trackId +
                ", uid=" + uid +
                ", playUrl64='" + playUrl64 + '\'' +
                ", playUrl32='" + playUrl32 + '\'' +
                ", downloadUrl='" + downloadUrl + '\'' +
                ", playPathAacv164='" + playPathAacv164 + '\'' +
                ", playPathAacv224='" + playPathAacv224 + '\'' +
                ", downloadAacUrl='" + downloadAacUrl + '\'' +
                ", title='" + title + '\'' +
                ", duration='" + duration + '\'' +
                ", processState=" + processState +
                ", createdAt=" + createdAt +
                ", coverSmall='" + coverSmall + '\'' +
                ", coverMiddle='" + coverMiddle + '\'' +
                ", coverLarge='" + coverLarge + '\'' +
                ", nickname='" + nickname + '\'' +
                ", smallLogo='" + smallLogo + '\'' +
                ", userSource=" + userSource +
                ", albumId=" + albumId +
                ", albumTitle='" + albumTitle + '\'' +
                ", albumImage='" + albumImage + '\'' +
                ", orderNum=" + orderNum +
                ", opType=" + opType +
                ", refUid='" + refUid + '\'' +
                ", refNickname='" + refNickname + '\'' +
                ", refSmallLogo='" + refSmallLogo + '\'' +
                ", isPublic=" + isPublic +
                ", likes=" + likes +
                ", playtimes=" + playtimes +
                ", comments=" + comments +
                ", shares=" + shares +
                ", status=" + status +
                ", downloadSize=" + downloadSize +
                ", downloadAacSize=" + downloadAacSize +
                '}';
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {

        dest.writeLong(trackId);
    }
    public static final Parcelable.Creator<Tracks> CREATOR = new Creator<Tracks>() {

        @Override
        public Tracks[] newArray(int size) {
            // TODO Auto-generated method stub
            return new Tracks[size];
        }

        @Override
        public Tracks createFromParcel(Parcel source) {
            // 从Parcel中读取数据，返回person对象    --------------按顺序读
            return new Tracks(source.readLong());
        }
    };

}
